package com.k136.config;

import com.k136.config.interceptor.UserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import javax.annotation.Resource;
import java.util.Arrays;

/**
 * TODO 类
 *
 * @author LiuTai
 * @version 1.00
 * @Date 2024/9/2
 */
@Configuration
public class WebConfig  implements WebMvcConfigurer {
    @Resource
    private UserInterceptor userInterceptor;
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userInterceptor)
            .addPathPatterns(Arrays.asList("/**"))
            .excludePathPatterns(Arrays.asList("/add/**"));
    }
}
